package com.wz.dao;

import com.wz.pojo.Transaction;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Repository
public interface TransactionDao {

	@Insert("insert into transaction(hash,nonce,blockHash,blockNumber,transactionIndex,fromAdd,toAdd,value,gasPrice,gas,gasUsed,contractAddress,status,gasLimit,kind) values(#{hash},#{nonce},#{blockHash},#{blockNumber},#{transactionIndex},#{fromAdd},#{toAdd},#{value},#{gasPrice},#{gas},#{gasUsed},#{contractAddress},#{status},#{gasLimit},#{kind})")
	@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")/*增加这个注解插入记录后会返回自增长的id*/
	void insertTransaction( Transaction transaction);
}
